//
//  BottomDetailView.m
//  SYiDaiy
//
//  Created by dllo on 16/9/20.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "BottomDetailView.h"
#import "TAMacro.h"

@implementation BottomDetailView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _xinlangButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_xinlangButton setTitle:@"通过新浪微博分享" forState:UIControlStateNormal];
        _xinlangButton.backgroundColor = [UIColor orangeColor];
        _weixinButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_weixinButton setTitle:@"微信" forState:UIControlStateNormal];
        _weixinButton.backgroundColor = [UIColor redColor];
        _friendsButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_friendsButton setTitle:@"朋友圈" forState:UIControlStateNormal];
        _friendsButton.backgroundColor = [UIColor redColor];
        _atopButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_atopButton setTitle:@"top" forState:UIControlStateNormal];
        _atopButton.backgroundColor = [UIColor greenColor];
        _abottomButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_abottomButton setTitle:@"bottom" forState:UIControlStateNormal];
        _abottomButton.backgroundColor = [UIColor blueColor];
        _mailButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _mailButton.backgroundColor = [UIColor redColor];
        [_mailButton setTitle:@"mail" forState:UIControlStateNormal];
        _collectionButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _collectionButton.backgroundColor = [UIColor yellowColor];
        [_collectionButton setImage:[UIImage imageNamed:@"IconMoreFav"] forState:UIControlStateNormal];
        [self addSubview:_xinlangButton];
        [self addSubview:_weixinButton];
        [self addSubview:_friendsButton];
        [self addSubview:_atopButton];
        [self addSubview:_abottomButton];
        [self addSubview:_mailButton];
        [self addSubview:_collectionButton];
    }
    return self;
}

- (void)layoutSubviews
{
    CGFloat buttonWidth = SCREEN_WIDTH - 30;
    _xinlangButton.frame = CGRectMake(5, 5, buttonWidth, 30);
    _weixinButton.frame = CGRectMake(5, 40, buttonWidth * 2 / 3, 30);
    _friendsButton.frame = CGRectMake(buttonWidth * 2 / 3, 40, buttonWidth / 3, 30);
    CGFloat topButtonWidth = (buttonWidth - 15) / 4;
    _atopButton.frame = CGRectMake(5, 75, topButtonWidth, 30);
    _abottomButton.frame = CGRectMake(topButtonWidth + 5, 75, topButtonWidth, 30);
    _mailButton.frame = CGRectMake(topButtonWidth * 2 + 10, 75, topButtonWidth, 30);
    _collectionButton.frame = CGRectMake(topButtonWidth * 3 + 15, 75, topButtonWidth, 30);
    
    
    
    
    
}


@end
